<!DOCTYPE html>
<html>
<head>
<title>规格管理</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css"  media="all"/>
<link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all"/>
<link rel="stylesheet"  href="../../../css/common/loader.css" media="all"/>
<link rel="stylesheet"  href="../../../css/common/tablepage.css" media="all"/>
</head>
<style>
	.sort-box{margin:0 5px;}
	.sort-box:hover{cursor: pointer;}
</style>
<body>
	<div class="layui-fluid">
		<div class="layui-card">
			<div class="layui-form layui-card-header layuiadmin-card-header-auto" id="searchForm">
			    <div class="layui-form-item">
					<div class="layui-inline">
						<label class="layui-form-label">カテゴリー</label>
						<div class="layui-input-block">
							<input type="text" name="stepName"  autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-inline">
					   <button class="layui-btn layuiadmin-btn-sm" lay-submit lay-filter="searchSubmit">検索</button>
					</div>
				</div>
			</div>
			<div class="layui-card-body">
				<table id="dataList" lay-filter="dataList" ></table>
			</div>
		</div>
	</div>
<div type="text/html" id="trTool" style="display:none">
    <a  data-grant="buss:menuCatalog:edit" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>編集</a>
    <a  data-grant="buss:menuCatalog:remove" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>削除</a>
</div>

<div type="text/html" id="toolbar" style="display:none" >
	<div class="layui-btn-container">
		 <button data-grant="buss:menuCatalog:add"   class="layui-btn layui-btn-sm" lay-event="add"> <i class="layui-icon layui-icon-add-1"></i>追加</button>
	</div>
</div>
<script src="../../../layuiadmin/layui/layui.js"></script>
<script type="text/javascript" src="../../../lib/jQuery-2.2.0.min.js" ></script>
	<script>
		layui.config({
			base :  '../../../layuiadmin/' //静态资源所在路径
		}).extend({
			webplus : 'lib/webplus'//主入口模块
			
		}).use([ 'table','form','webplus' ], function() {
			var $ = layui.$,
			webplus=layui.webplus,
			form = layui.form,
			table = layui.table;
			
		   var cols= [ [ {
				type : 'numbers',
				title : '番号',
				width:140
			}, 
			{
				field : 'stepNum',
				title : '表示順番'
			},
			{
				field : 'stepName',
				title : 'オプション（大）'
			},
			{
				field : 'createTime',
				title : '作成時間'
			},
			{
				title : '編集',
				toolbar : '#trTool',
				fixed: 'right',
				width : 180
			} ] ];
			// 获取菜品ID
			var urlData= webplus.getUrlType();
		   webplus.init('buss/menuDict/listMenuStep?menuIndexId='+urlData.id,cols);
			 //监听行工具事件
			  table.on('tool(dataList)', function(rowObj){
			    switch(rowObj.event){
			    	case 'edit':
			    		webplus.openEditWindow('editSpecsList.html','編集',rowObj,'stepIndexId','','900','');
			   			break;
			    	case 'del':
				        webplus.removeRow('buss/menuDict/removeMenuStep',rowObj,'stepId','','','規格を削除しますか？');
			    		break;
			    }
			  });
			 //监听表头按钮事件
			  table.on('toolbar(dataList)', function(obj){
			    switch(obj.event){
			      	case 'add':
				         //打开添加弹出框
				         webplus.openWindow('addSpecsList.html?menuIndexId='+urlData.id,'追加','900','');
			     	     break;
			    }
			  });

		});
	</script>

</body>
</html>